package com.jjsj.mall.shop.service.impl;

import com.jjsj.mall.shop.entity.YoshopOrderGoods;
import com.jjsj.mall.shop.mapper.YoshopOrderGoodsMapper;
import com.jjsj.mall.shop.service.IYoshopOrderGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单商品Service业务层处理
 *
 * @author www.joolun.com
 * @date 2022-10-24
 */
@Service
public class YoshopOrderGoodsServiceImpl implements IYoshopOrderGoodsService {
    @Autowired
    private YoshopOrderGoodsMapper yoshopOrderGoodsMapper;

    /**
     * 查询订单商品
     *
     * @param orderGoodsId 订单商品ID
     * @return 订单商品
     */
    @Override
    public YoshopOrderGoods selectYoshopOrderGoodsById(String orderGoodsId) {
        return yoshopOrderGoodsMapper.selectYoshopOrderGoodsById(orderGoodsId);
    }

    /**
     * 查询订单商品列表
     *
     * @param yoshopOrderGoods 订单商品
     * @return 订单商品
     */
    @Override
    public List<YoshopOrderGoods> selectYoshopOrderGoodsList(YoshopOrderGoods yoshopOrderGoods) {
        return yoshopOrderGoodsMapper.selectYoshopOrderGoodsList(yoshopOrderGoods);
    }

    /**
     * 新增订单商品
     *
     * @param yoshopOrderGoods 订单商品
     * @return 结果
     */
    @Override
    public int insertYoshopOrderGoods(YoshopOrderGoods yoshopOrderGoods) {
        return yoshopOrderGoodsMapper.insertYoshopOrderGoods(yoshopOrderGoods);
    }

    /**
     * 修改订单商品
     *
     * @param yoshopOrderGoods 订单商品
     * @return 结果
     */
    @Override
    public int updateYoshopOrderGoods(YoshopOrderGoods yoshopOrderGoods) {
        return yoshopOrderGoodsMapper.updateYoshopOrderGoods(yoshopOrderGoods);
    }

    /**
     * 批量删除订单商品
     *
     * @param orderGoodsIds 需要删除的订单商品ID
     * @return 结果
     */
    @Override
    public int deleteYoshopOrderGoodsByIds(String[] orderGoodsIds) {
        return yoshopOrderGoodsMapper.deleteYoshopOrderGoodsByIds(orderGoodsIds);
    }

    /**
     * 删除订单商品信息
     *
     * @param orderGoodsId 订单商品ID
     * @return 结果
     */
    @Override
    public int deleteYoshopOrderGoodsById(String orderGoodsId) {
        return yoshopOrderGoodsMapper.deleteYoshopOrderGoodsById(orderGoodsId);
    }
}
